package main

import (
	"fmt"
	. "encoding/json"
)

type Book struct {
	Title       string
	Authors     []string
	Publisher   string
	IsPublished bool
	Price       float32
}

func main() {
	gobook := Book{"Go语言编程",
		[]string{"XuShiwei", "HughLv", "Pandaman", "GuaguaSong", "BertYuan", "HanTuo", "XuDaoli"},
	"ituring.com.cn",
	true,
		9.99,
	}
	bytes, _ := Marshal(gobook)
	fmt.Println(bytes)
	fmt.Println(string(bytes))
	var gobook1 Book
	Unmarshal(bytes,&gobook1)
	fmt.Println(gobook1)
}
